From: Aravindh Puthiyaparambil Date: Wed, 18 Apr 2012 12:38:47 +0000 (+0100) Subject: mem_access: fix setting default mem_access type X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=07e4376ae0cd6dff3385362b4f0ebae35762ad9d;p=xen.git mem_access: fix setting default mem_access type When xc_hvm_set_mem_access(xch, domain_id, default_access, ~0ull, 0) is called, first_pfn=~0ull is a hint to HVMOP_set_mem_access as to what the default mem_access type is for the domain. This call was failing because it was gated by the memory range check in the HVMOP_set_mem_access case statement in do_hvm_op(). The following patch fixes this issue. Signed-off-by: Aravindh Puthiyaparambil Acked-by: Tim Deegan Committed-by: Tim Deegan --- xen/arch/x86/hvm/hvm.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) --- diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 80f31548c1..e353acfb2e 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4195,9 +4195,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg) goto param_fail5; rc = -EINVAL; - if ( (a.first_pfn > domain_get_maximum_gpfn(d)) || + if ( (a.first_pfn != ~0ull) && + ((a.first_pfn > domain_get_maximum_gpfn(d)) || ((a.first_pfn + a.nr - 1) < a.first_pfn) || - ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d)) ) + ((a.first_pfn + a.nr - 1) > domain_get_maximum_gpfn(d))) ) goto param_fail5; rc = p2m_set_mem_access(d, a.first_pfn, a.nr, a.hvmmem_access);